<?php

namespace backend\models;

use Yii;

/**
 * This is the model class for table "tme_merchandiseavg".
 *
 * @property integer $ID
 * @property integer $TMe_ID
 * @property string $MerchandiseID
 * @property integer $Number
 * @property double $AvgPrince
 *
 * @property TmeMerchandiseinfo $tMe
 */
class TmeMerchandiseavg extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'tme_merchandiseavg';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['TMe_ID', 'Number'], 'integer'],
            [['AvgPrince'], 'number'],
            [['MerchandiseID'], 'string', 'max' => 20]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'ID' => 'ID',
            'TMe_ID' => 'Tme  ID',
            'MerchandiseID' => 'Merchandise ID',
            'Number' => 'Number',
            'AvgPrince' => 'Avg Prince',
        ];
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getTMe()
    {
        return $this->hasOne(TmeMerchandiseinfo::className(), ['ID' => 'TMe_ID', 'MerchandiseID' => 'MerchandiseID']);
    }
}
